package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.ProcessRecord;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/ProcessRecordMapper.class */
public interface ProcessRecordMapper {
    @Insert({"insert into processrecord (project_id,process_name,process_time,submit_id,approver_id,opinion,status) values (#{projectId},#{processName},#{processTime},#{submitId},#{approverId},#{opinion},#{status})"})
    int add(ProcessRecord processRecord);

    @Select({"select * from processrecord where project_id = #{projectId}"})
    @Results({@Result(property = "projectId", column = "project_id"), @Result(property = "processName", column = "process_name"), @Result(property = "processTime", column = "process_time"), @Result(property = "submitId", column = "submit_id"), @Result(property = "approverId", column = "approver_id")})
    List<ProcessRecord> findAll(int i);

    @Update({"update processrecord set status=#{status}, opinion=#{opinion},approver_id=#{approverId} where project_id=#{projectId} and process_name=#{processName}"})
    Integer updateStatus(ProcessRecord processRecord);

    @Select({"select * from processrecord where project_id = #{projectId} and process_name = #{processName} limit 1"})
    @Results({@Result(property = "projectId", column = "project_id"), @Result(property = "processName", column = "process_name"), @Result(property = "processTime", column = "process_time"), @Result(property = "submitId", column = "submit_id"), @Result(property = "approverId", column = "approver_id")})
    ProcessRecord findOne(ProcessRecord processRecord);

    @Select({"SELECT p.*,u.name FROM processrecord p LEFT JOIN USER u ON p.submit_id = u.id where p.project_id = #{projectId} and p.process_name = #{processName}"})
    @Results({@Result(property = "projectId", column = "project_id"), @Result(property = "processName", column = "process_name"), @Result(property = "processTime", column = "process_time"), @Result(property = "submitId", column = "submit_id"), @Result(property = "approverId", column = "approver_id")})
    List<ProcessRecord> findByProjectId(Integer num, String str);
}